$(".am-form").submit(function () {
    var formData = $('.am-form').serialize();
    $.ajax({
        url:'../pdosub',
        data:formData,
        type:'post',
        dataType:'json',
        success:function (data) {
            if (data['status'] == 1){
                layer.msg("提问发表成功！",{offset:'50%',icon:6,time:1000},function () {
                    location.href = 'phone';
                });
            } else if (data['status'] == 2) {
                layer.msg("您还没有登录，请先前去登录！",{offset:"50%",icon:6,time:1000},function () {
                    location.href = 'doplogin';
                });
            } else {
                layer.msg("发表失败！",{offset:"50%",icon:6,time:1000},function () {
                    location.reload();
                });
            }
        }
    })
    return false;
});